<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
			<img src="img/图片切换/1.jpg" >
		
		<button type="button" onclick="aa()">开始</button>
	</body>
	<script type="text/javascript">
		
		var imgarr=["img/图片切换/1.jpg","img/图片切换/2.jpg","img/图片切换/3.jpg","img/图片切换/4.jpg","img/图片切换/5.jpg","img/图片切换/6.jpg","img/图片切换/7.jpg","img/图片切换/8.jpg","img/图片切换/9.jpg"];
		var img=document.getElementsByTagName("img")[0];
		var index=0;
		var num =0;
		function aa(){
		num++;
		if(num>0){
		    var timer=setInterval(function(){
		    index++;
		   if(index>imgarr.length-1){
		       index=0;
		   }
		    img.src=imgarr[index];
		    
		    },800);
		}
		}
	</script>
</html>
